import Vue from 'vue';
import VueRouter from 'vue-router';
const vueRouterpush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(to) {
return vueRouterpush.call(this, to) .catch(err => err)
}
Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'indexView',
    component: () => import('../views/indexView.vue'),
  },
  {
    path: '/study',
    name: 'onStudy',
    component: () => import('../views/onStudyView.vue'),

  },

  {
    path: '/member',
    name: 'myInfo',
    component: () => import('../views/member/myInfoView.vue'),
    
  },
  {
    path: '/member/messages',
    name: 'myMessage',
    component: () => import('../views/member/myMessage.vue'),
    meta:{
      auth:true,
    }
  },
  {
    path: '/member/setting',
    name: 'setting',
    component: () => import('../views/member/setting.vue'),
    meta:{
      // auth:true,
    }
  },
  {
    path: '/member/userInfo',
    name: 'userInfo',
    component: () => import('../views/member/userInfo.vue'),
    meta:{
      auth:true,
    }
    
  },
  {
    path: '/member/order',
    name: 'myorder',
    component: () => import('../views/member/myOrder.vue'),
    meta:{
      auth:true,
    }
    
  },
  {
    path: '/member/promocode',
    name: 'promocode',
    component: () => import('../views/member/promoCode.vue'),
    meta:{
      auth:true,
    }
    
  },


  {
    path: '/login',
    name: 'login',
    component: () => import('../views/loginView.vue'),
  },
  {
    path: '/vod',
    name: 'lessonAll',
    component: () => import('../views/vod/lessonAll.vue'),
  },
  {
    path: '/vod/detail',
    name: 'Detail',
    component: () => import('../views/lessonDetail.vue'),
  },

  {
    path: '/role',
    name: 'vip',
    component: () => import('../views/vip/vipPage.vue'),
    meta:{
      auth:true,
    }
  },
  {
    path: '/order',
    name: 'checkOut',
    component: () => import('../views/vip/vipCheckOut.vue'),
    meta:{
      auth:true,
    }
  }
];

const router = new VueRouter({
  routes,
});

export default router;
